package com.zhj.rabbitmq.demo.confirm;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author zhengjibin
 * @version 1.0.0
 * @ClassName ConfirmRabbitmqConsumer.java
 * @Description 发送确认消息接收
 * @createTime 2023年03月25日 11:26:00
 */
@Component
public class ConfirmRabbitmqConsumer {

    @RabbitListener(queues = {ConfirmRabbitmqConfig.QUEUE_NAME})
    public void consumer1(Message message){
        System.out.println("接收：发送确认模式消息："+new String(message.getBody()));
        /*try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
    }
}
